<script setup>


import blogStore from "@/stores/blog.js";
import {ArrowDown} from "@element-plus/icons-vue";


const goBack = () => {
  router.back()
  console.log('go back')
}
const blog = blogStore()


/*退出登陆按钮,取面包屑的key*/

const router = useRouter()
const Logout = () => {
  blog.token = ''
  blog.user = ''
  ElMessage({
    showClose: true,
    message: '退出成功！'

  })
  router.push("/login")
}
</script>

<template>
  <div style="margin-top: 15px;margin-right: 10px;">
    <el-card class="top-conte" shadow="always">
      <!--返回按钮-->
      <el-page-header style="width: 300px;color: rgba(49,114,58,0.81)" title="返回" @back="goBack">
        <!--面包屑-->
        <template #breadcrumb>
          <el-breadcrumb-item style="color: #10101d">
            {{ blog.key }}
          </el-breadcrumb-item>
        </template>

        <template #content>
          <span class="text-large font-600 mr-3"> cooting博客 </span>
        </template>


      </el-page-header>
      <!--       退出登陆和用户右上角 -->
      <div class="lg-down">
        <el-dropdown>
    <span class="el-dropdown-link">
        {{ blog.user }}
      <el-icon class="el-icon--right">
        <arrow-down/>
      </el-icon>
    </span>
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item>个人中心</el-dropdown-item>
              <el-dropdown-item @click="Logout">退出登陆</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
      </div>
    </el-card>


  </div>
</template>

<style scoped>


.el-dropdown-link:focus {
  outline: none; /*去掉右上角点击线框*/
}

.lg-down {
  position: absolute;
  right: 0;
  top: 60px; /* 移动到容器的一半高度 */
  margin-right: 50px;

}

.top-conte {
  /*  background-color: rgba(238, 238, 245, 0.5);*/
  border-radius: 5px; /*角度圆弧形*/

}
</style>